package com.spring.cloud.service;

/**
 * @Created on 2021/5/15.
 * @Author by zbk
 * @Description:
 */

import com.alibaba.csp.sentinel.adapter.servlet.callback.RequestOriginParser;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;

// 系统控制规则
@Component
public class RequestOriginParserDefinition implements RequestOriginParser {
    @Override
    public String parseOrigin(HttpServletRequest request) {
        String serviceName = request.getParameter("serviceName");// 指定应用入口
        return serviceName;
    }
}